<template>
    <div class="user-comment-wrap df">
        <div class="left fn">
            <van-image round width="50px" height="50px" :src="item.avatar" />
        </div>
        <div class="right f1">
            <div class="user-time df aic jcsb">
                <div class="user">{{ item.username }}</div>
                <div class="time">{{ item.rateTime | setTimen }}</div>
            </div>
            <div class="comment-time">
                <van-rate v-model="item.score" allow-half void-icon="star" readonly color="#ffc300" size="14px" />
                <span v-if="item.deliveryTime">{{ item.deliveryTime }}分钟送达</span>
            </div>
            <p>{{ item.text }}</p>
            <div class="tabs df">
                <van-icon size="16px" color="#ffc300" name="good-job" />
                <div class="tab">
                    <van-tag v-for="v in item.recommend" :key="v" color="#999" plain type="primary">{{ v }}</van-tag>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        item: {
            type: Object
        }
    }
}
</script>

<style lang="scss" scoped>
.user-comment-wrap {
    padding: 30px 0;
    border-bottom: 1px solid #f2f1f1;

    .right {
        margin-left: 10px;

        .user-time {
            margin-bottom: 8px;

            .user {
                font-weight: bold;
            }

            .time {
                color: #999;
            }
        }

        .comment-time {
            margin-bottom: 8px;

            span {
                margin-left: 10px;
                color: #999;
            }
        }

        p {
            font-size: 14px;
            margin-bottom: 8px;
            line-height: 22px;
        }

        .tabs {
            .tab {
                margin-left: 10px;

                .van-tag {
                    margin: 0px 3px 5px 3px;
                }
            }
        }
    }
}
</style>